﻿CREATE TABLE [account].[Account] (
    [AccountId]         SMALLINT      IDENTITY (1, 1) NOT NULL,
    [AccountLegacyId]   INT           NOT NULL,
    [AccountCode]       VARCHAR (8)   NOT NULL,
    [AccountType]       CHAR (1)      NOT NULL,
    [AccountName]       VARCHAR (100) NOT NULL,
    [AccountCateryId]   SMALLINT      NOT NULL,
    [AccountCateryCode] CHAR (3)      NOT NULL,
    [AccountOwnerId]    SMALLINT      NULL,
    [AccountOpenedDate] DATE          NULL,
    [AccountClosedDate] DATE          NULL,
    [AccountClosedBy]   NVARCHAR (20) NULL,
    [IsLatest]          BIT           NOT NULL,
    [IsActive]          BIT           NOT NULL,
    [IsInternal]        BIT           NOT NULL,
    PRIMARY KEY CLUSTERED ([AccountId] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF)
);

